<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>随机页面</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <script src="../../script/vue.min.js"></script>
    <style>
        #wrap {
            height: 100%;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            -webkit-box-orient: vertical;
            -webkit-flex-flow: column;
            flex-flow: column;
        }
        #header {
            background: #fbdb0a;
            color: #000;
            border-bottom: #b2b2b2 solid 1px;
        }
        #main {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
        }
    </style>
</head>

<body>
    <div v-cloak id="wrap">
        <header id="header" class="aui-bar aui-bar-nav">
            <a class="aui-pull-left">
                <span class="aui-iconfont aui-icon-left" style="color:#000" @click="leftWin" id="headerBack">一定要借到</span>
            </a>
            <div class="aui-title" id="headerText">loading...</div>
        </header>
        <div id="main" class="flex-con" style="height: 800px"></div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
apiready = function() {
    open()
    var vm = new Vue({
        el: '#wrap',
        data: {
            headerBack: '一定要借到',
            headerText: 'loading...'
        },
        methods: {
            leftWin: function() {
                api.closeWin();
                api.openWin({
                    name: 'menu_three',
                    url: 'menu_three.html'
                });
            }
        },
        created: function() {
        },
        mounted: function() {

        },
    })
    headerBack = $api.byId('headerBack');
    headerText = $api.byId('headerText');
    api.setFrameClient({
        frameName: 'wrap_link_frame'
    }, function(ret, err) {
        switch (ret.state) {
            case 0:
                break;
            case 1:
                break;
            case 2:
                break;
            case 3:
                headerBack.innerHTML = 'back'
                headerText.innerHTML = ret.title
                break;
            case 4:
                break;
            default:
                break;
        }
    });

};


var header, headerPos, main, mainPos

function open() {
    header = $api.byId('header');
    //适配iOS 7+，Android 4.4+状态栏
    $api.fixStatusBar(header);
    headerPos = $api.offset(header);
    main = $api.byId('main');
    mainPos = $api.offset(main);
    api.openFrame({
        name: 'wrap_link_frame',
        url: 'http://res.txingdai.com/site/d/7e49ec05b3bf157f58407ec0b2ca81b8',
        bounces: false,
        progress: {
            type: 'page',
            color: "#ff8400"
        },
        rect: {
            x: 0,
            y: headerPos.h,
            w: 'auto'
        }
    });
}
</script>

</html>
